﻿@using Telerik.Web.Mvc;
@using Telerik.Web.Mvc.UI
@using Nop.Services.Common;
@using Nop.Core.Domain.Logistics;
@model IEnumerable<LogisticsPackage>

<table class="adminContent">
    <tr>
        <td>
            @(Html.Telerik().Grid<LogisticsPackage>(Model)
                .Name("pending-packages")
                .Columns(columns =>
                {
                    columns.Bound(x => x.Id);
                    columns.Bound(x => x.ShipmentId);
                    columns.Bound(x => x.Shipment.TrackingNumber);
                    columns.Bound(x => x.Status);
                    columns.Bound(x => x.CreatedOnUtc);
                    @*TODO: Need to support property or field for address here*@
                    columns.Template(x => x.PickUpLocation.Address.FormattedAddress()).Title(T("Admin.Logistics.PickupAddress").Text);
                    columns.Template(x => x.DeliveryLocation.Address.FormattedAddress()).Title(T("Admin.Logistics.DeliveryAddress").Text);
                    columns.Template(x => x.Warehouse.Address.FormattedAddress()).Title(T("Admin.Logistics.WarehouseAddress").Text);
                    
                })
                .DataBinding(dataBinding => dataBinding.Ajax().Select("PendingPackagesList", "Logistics"))
                .EnableCustomBinding(true))
        </td>
    </tr>
</table>
